package com.supermap.application.controller;

import com.supermap.application.service.MessageManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @ClassName MessageManageController
 * @Description 消息管理接口
 * @Author HEKE
 * @Date 2019/3/5 21:02
 */

@Controller
@RequestMapping(value = "/message")
public class MessageManageController {

    @Autowired
    private MessageManageService messageManageService;

    @CrossOrigin
    @RequestMapping(value = "/get/user/id")
    @ResponseBody
    public String getIds(String phone){
        return messageManageService.getUserIdByPhone(phone);
    }

    @CrossOrigin
    @RequestMapping(value = "/send/app/msg")
    @ResponseBody
    public String sendMsg(String title, String content, String ids, String appHandUrl){
        return messageManageService.sendMsgToApp(title, content, ids, appHandUrl);
    }
}
